package com.spvs.system.common;

import lombok.Getter;

import java.util.Arrays;

@Getter
public enum ReceiptTypeEnum {
    CAI_GOU_RU_KU(0, "采购入库"),

    LING_YONG_HUAN_HUI(1, "领用还回"),

    GENG_HUAN_LING_YONG(2, "更换领用");


    ReceiptTypeEnum(Integer code, String desc){
        this.code = code;
        this.desc = desc;
    }
    private Integer code;
    private String desc;


    public static ReceiptTypeEnum getByFormCode(Integer code){
        return Arrays.stream(ReceiptTypeEnum.values())
                .filter(value -> value.getCode().equals(code))
                .findFirst().orElse(null);
    }
}
